<?php
include_once 'core/Node.php';

class LinkInterpreter{
	public function interpret(Node $node){
		$link = $node->getAttribute('@0');
		$text = $node->getAttribute('@1');
		$target = $node->getAttribute('@2');

		$ret = '<a href="'.$link.'"';
		if($target != ''){
			$ret .= ' target="'.$target.'"';
		}
		$ret .= '>'.$text.'</a>';

		return $ret;
	}
}